package com.ace.explore.users.controller;

import com.ace.explore.users.model.UserBasicInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * Created by zhangwanli on 2017/9/10.
 */
@RestController
@RequestMapping("/basic-info")
@Api(tags = "用户基本信息", description = "/basic-info")
public class UserBasicInfoController {

    @GetMapping("/{userName}")
    @ApiOperation("根据用户名查询用户信息")
    @ApiParam(value = "用户名", name = "userName")
    public UserBasicInfo queryUserByName(@PathVariable String userName) {
        UserBasicInfo basicInfo = new UserBasicInfo();
        basicInfo.setUserId(684564136516515L);
        basicInfo.setUserName(userName);
        basicInfo.setNickName("小张");
        return basicInfo;
    }

    @GetMapping("/test")
    @ApiOperation("测试多参数")
    public Boolean testMultiParams(String name, Date birth, Integer age) {
        System.out.println(name);
        System.out.println(birth);
        System.out.println(age);
        return true;
    }
}
